import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import java.util.ArrayList;

import javax.swing.JPanel;


public class Figure {
	ArrayList<Line> lines = new ArrayList<Line>();
	ArrayList<Point> points = new ArrayList<Point>();
	public Figure(ArrayList<Point> pnts){
		points = pnts;
	}
	public void updPoints (ArrayList<Point> pnts){
		points = pnts;
	}
	public ArrayList<Line> getLines(){
		boolean start = false;
        Point p0 = null; 
        for (Point p : points) {
        	if (start) {
        		lines.add(new Line (p0, p));
        	} else {
        		start = true;
        	}
        	p0 = p;
          }
		return lines;
	}
}
